package com.kingschan.jeasytag.core.validation.properties;

import java.util.HashMap;
import java.util.Map;
import com.kingschan.jeasytag.core.validation.properties.impl.BooleanFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.EventFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.IntArrayFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.JsonArrayFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.JsonFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.NumberFieldValidationImpl;
import com.kingschan.jeasytag.core.validation.properties.impl.StringFieldValidationImpl;
/**
 * 
 * @author kingschan
 *date:2013-7-11
 */
public class ValidationFactory {
	private static Map<String, PropertiesValidation> validation;
	static{
		validation = new HashMap<String, PropertiesValidation>();
		
		validation.put("BooleanField", new BooleanFieldValidationImpl() );
		validation.put("EventField", new EventFieldValidationImpl());
		validation.put("IntArrayField", new IntArrayFieldValidationImpl() );
		validation.put("JsonArrayField", new JsonArrayFieldValidationImpl());
		validation.put("JsonField", new JsonFieldValidationImpl());
		validation.put("NumberField", new NumberFieldValidationImpl());
		validation.put("StringField", new StringFieldValidationImpl());
	}
	/**
	 * PropertiesValidation
	 * @param key
	 * @return
	 */
	public static PropertiesValidation getValidation(String key){
		return validation.get(key);
	}
}
